<script>
/**
 * @desc 产品详情
 */

export default {
  name: 'product-details',
  props: { data: Object }
}
</script>

<template>
  <div class="product-details">
    <div class="about">
      <h1 class="name">{{data.name}}</h1>
      <p class="sub-title-bar">
        <span class="sub-title">{{data.labelList?data.labelList[0]:''}}</span>
        <span class="flog" v-if="data.isVisa">免签</span>
      </p>
      <p class="price">￥{{data.singlePersonPrice}}</p>
    </div>

    <div class="content-list">
      <div
        v-for="(v,i) in data.routeIntros"
        :key="i"
        class="content"
      >
        <h2 v-if="v.type==='title'" class="title">{{v.content}}</h2>
        <p v-else-if="v.type==='text'" class="text">{{v.content}}</p>
        <div v-else-if="v.type==='img'" class="img-wrap">
          <img  :src="'https://source.hilval.com'+v.content" class="image" mode="aspectFill">
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.product-details {
  .about {
    text-align: center;
    background-color: #fff;
    line-height: 1.2;
    margin-bottom: 10px;
    .name {
      font-size: 20px;
    }
    .sub-title-bar {
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .sub-title {
      max-width: 80%;
      font-size: 16px;
    }
    .flog {
      padding: 2px 4px;
      margin-left: 5px;
      color: #ff4700;
      font-size: 14px;
      border-radius: 5px;
      border: 1px solid #ff4700;
    }

    .price {
      color: $main-color;
      font-size: 20px;
      font-weight: bold;
    }

    .name,
    .sub-title,
    .price {
      padding: 10px 0;
    }
  }

  .content-list {
    box-sizing: border-box;
    background-color: #fff;
  }
  .title {
    line-height: 2.5;
    text-align: center;
    color: #ff4d6c;
    font-size: 20px;
  }
  .text {
    margin: 10px;
    padding: 10px 0;
    line-height: 1.5;
    font-size: 16px;
    color: $gray-font-color;
  }

  .img-wrap {
    margin: 10px;
  }
  .image {
    width: 100%;
    height: 400rpx;
  }
}
</style>
